<template>
  <div class="child">
    <h3>这是子组件</h3>
    <br>
    <button @click="count++">计数加一</button>
    <span>计数测试: {{count}}</span>
  </div>
</template>

<script>
import {ref} from 'vue'

export default {
  async setup() {
    let count = ref(0)
    let test = new Promise((resolve, reject) => {
      setTimeout(() => {
        resolve({count})
      }, 1000);
    })

    return await test
  },
}
</script>

<style scoped>
  .child {
    background-color: #a7e;
    padding: 5px;
  }
</style>